/**
 * 测试长连接的效果，创建一个客户端一直发送信息，直到超过超时时间看是否还会继续发送
 * 如果继续发送则表示成功，反之失败
*/
#include "HttpServer.hpp"
#include <mysql.h>

int main()
{
    Socket cli_sock;
    cli_sock.CreateClient(8085,"127.0.0.1");
    std::string req = "GET /Hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: \r\n\r\n";
    while(1)
    {
        assert(cli_sock.Send(req.c_str(),req.size()) != -1);
        char buf[1024] = {0};
        assert(cli_sock.Recv(buf,sizeof(buf) - 1));
        logMessage(DEBUG,"%s",buf);
        sleep(3);
    }
    cli_sock.Close();
    return 0;
}